﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiInvertedClipBoundary : OdGiAbstractClipBoundary
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiInvertedClipBoundary(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiInvertedClipBoundary_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiInvertedClipBoundary obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiInvertedClipBoundary()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiInvertedClipBoundary(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGiInvertedClipBoundary() : this(GlobalsPINVOKE.new_OdGiInvertedClipBoundary(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdGiAbstractClipBoundary.BoundaryType type()
		{
			OdGiAbstractClipBoundary.BoundaryType result = (OdGiAbstractClipBoundary.BoundaryType)GlobalsPINVOKE.OdGiInvertedClipBoundary_type(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2dArray invertedClipBoundary()
		{
			OdGePoint2dArray result = new OdGePoint2dArray(GlobalsPINVOKE.OdGiInvertedClipBoundary_invertedClipBoundary(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setInvertedClipBoundary(OdGePoint2dArray pPoints)
		{
			GlobalsPINVOKE.OdGiInvertedClipBoundary_setInvertedClipBoundary(this.swigCPtr, OdGePoint2dArray.getCPtr(pPoints).Handle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdGiAbstractClipBoundary clone()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGiInvertedClipBoundary_clone(this.swigCPtr);
			OdGiAbstractClipBoundary result = (intPtr == IntPtr.Zero) ? null : new OdGiAbstractClipBoundary(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
